package com.joker.product.controller;

import com.joker.common.core.domain.Result;
import com.joker.product.service.ItemInfoService;
import com.joker.product.vo.ItemInfoVo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.concurrent.ExecutionException;

@RestController
@RequestMapping("/item")
public class ItemInfoController {
    @Resource
    private ItemInfoService itemInfoService;
    /**
     * 查询商品详情
     */
    @GetMapping("/{skuId}")
    public Result<ItemInfoVo> getItemInfoVo(@PathVariable Long skuId) throws ExecutionException, InterruptedException {
        return Result.success(itemInfoService.getItemInfoVo(skuId));
    }
}
